<?php
namespace app\index\Controller;
use app\index\model\Areasmodel;
use think\Controller;
use think\Loader;


class Areas extends Controller{

    public function index(){
    return $this->fetch();

    }
    public function province(){
        $model=new Areasmodel();
        $data=$model->select1();
        echo json_encode($data);
    }
    public function city(){
        $id=$_POST['areaSort'];
        $model=new Areasmodel();
        $data=$model->selectsq($id);
        echo json_encode($data);
    }
    public function sw(){
        $id=$_POST['areaSort'];
        $model=new Areasmodel();
        $data=$model->selectsw($id);
        echo json_encode($data);
    }


    public function areas(){
        $callback = $_GET['callback'];
        $mode=new Areasmodel();
        $id=0;
        $data=$mode->select($id);
//        var_dump($data)  ;
        echo $callback."(".$data.")";
//        echo json_encode($data);
//        echo $callback."(66)";
    }

}